<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.math.impl.BignumX86</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.math.impl.BignumX86");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/impl/BignumX86.d?rev=3791">tango.math.impl.BignumX86</a></h1>
                
<font color="black">Optimised asm arbitrary precision arithmetic &#40;'bignum'&#41; 
 routines for X86 processors.</font><br><br>
<font color="black">All functions operate on arrays of uints, stored LSB first.
 If there is a destination array, it will be the first parameter.
 Currently, all of these functions are subject to change, and are
 intended for internal use only.<br><br> </font><br><br>
<b>Author:</b><br>Don Clugston<br><br>
<b>Date:</b><br>
May 2008.<br><br>
<b>License:</b><br>
Public Domain<br><br> In simple terms, there are 3 modern x86 microarchitectures:
 &#40;a&#41; the P6 family &#40;Pentium Pro, PII, PIII, PM, Core&#41;, produced by Intel;
 &#40;b&#41; the K6, Athlon, and AMD64 families, produced by AMD; and
 &#40;c&#41; the Pentium 4, produced by Marketing.<br><br> This code has been optimised for the Intel P6 family, except that it only
 uses the basic instruction set &#40;doesn't use MMX, SSE, SSE2&#41;
 Generally the code remains near-optimal for Core2, after translating
 EAX-&gt; RAX, etc, since all these CPUs use essentially the same pipeline.
 The code uses techniques described in Agner Fog's superb manuals available
 at www.agner.org.
 Not optimal for AMD64, which can do two memory loads per cycle &#40;Intel
 CPUs can only do one&#41;. Division is far from optimal.<br><br>  Timing results &#40;cycles per int&#41;
         PentiumM Core2
  +,-      2.25   2.25
  &amp;,|,^    2.0    2.0
  &lt;&lt;,&gt;&gt;    2.0    2.0
  cmp      2.0    2.0
  *        5.0
  mulAdd   5.4
  div     18.0<br><br>
<dl></dl></td></tr>
                <tr><td id="docfooter">
                         :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:34 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>